package homework;

import java.util.Scanner;

public class Test1 {
    public static void main(String[] args) {
        System.out.println("请录入工人姓名");
        Scanner scanner=new Scanner(System.in);
        Worker worker=new Worker();
        worker.setName(scanner.nextLine());
        System.out.println("请录入工人工龄");
        worker.setYear(scanner.nextInt());
        System.out.println("该工人对象的属性信息如下：");
        System.out.println("姓名："+worker.getName());
        System.out.println("工龄："+worker.getYear());

    }
}
